package cn.tedu.spring.auto;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * 1.接口对应的唯一实现类上添加:@Component注解、
 * 2.UserControllerAuto类中添加:@Component注解,交由Spring管理,
 *   实现对象类型数据属性注入(@Autowired 中指定接口名字)
 * 3.测试类进行测试
 */
public class TestUserControllerAuto {
    public static void main(String[] args) {
        ApplicationContext context = new AnnotationConfigApplicationContext("cn.tedu.spring.auto");
        UserControllerAuto userControllerAuto = context.getBean(UserControllerAuto.class);
        System.out.println(userControllerAuto);
    }
}
